home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / xinetd.2 / xinetd / xinetd.2.1.7-linux.4 / libs / src / misc / env.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-25  |  1.1 KB  |  63 lines

  1. /*
  2.  * (c) Copyright 1992 by Panagiotis Tsirigotis
  3.  * All rights reserved.  The file named COPYRIGHT specifies the terms 
  4.  * and conditions for redistribution.
  5.  */
  6.  
  7. #ifndef __ENV_H
  8. #define __ENV_H
  9.  
  10. /*
  11.  * $Id: env.h,v 1.2 1992/10/31 03:09:33 panos Exp $
  12.  */
  13.  
  14. struct __env
  15. {
  16.     unsigned max_vars ;
  17.     unsigned n_vars ;
  18.     char **vars ;
  19. } ;
  20.  
  21. typedef struct __env *env_h ;
  22.  
  23. #define ENV_NULL                        ((env_h)0)
  24.  
  25. /*
  26.  * Return values
  27.  */
  28. #define ENV_ERR                        (-1)
  29. #define ENV_OK                            0
  30.  
  31. /*
  32.  * Error codes
  33.  */
  34. #define ENV_ENOMEM                    1
  35. #define ENV_EBADVAR                    2
  36. #define ENV_EBADSTRING                3
  37.  
  38.  
  39. #ifdef __ARGS
  40. #undef __ARGS
  41. #endif
  42.  
  43. #ifdef PROTOTYPES
  44. #  define __ARGS( s )               s
  45. #else
  46. #  define __ARGS( s )               ()
  47. #endif
  48.  
  49. env_h env_create __ARGS( ( env_h ) ) ;
  50. void env_destroy __ARGS( ( env_h ) ) ;
  51. env_h env_make __ARGS( ( char **env_strings ) ) ;
  52. int env_addvar __ARGS( ( env_h, env_h from_env, char *var ) ) ;
  53. int env_addstr __ARGS( ( env_h, char *str ) ) ;
  54. int env_remvar __ARGS( ( env_h, char *var ) ) ;
  55. char *env_lookup __ARGS( ( env_h, char *var ) ) ;
  56.  
  57. #define env_getvars( env )                (env)->vars
  58.  
  59. extern int env_errno ;
  60.  
  61. #endif    /* __ENV_H */
  62.  
  63.